import React, {Component} from 'react'
import {Button, Pagination} from 'antd'

class PaginationComponent extends Component {
    render() {
        const {totalRow, pageSize, pageNumber, pageChangeHandle} = this.props;
        const paginationProps = {
            total: totalRow,
            showTotal: total => `共${total}条`,
            pageSize,
            current: pageNumber,
            showQuickJumper: true,
            pageSizeOptions: [10, 20, 50, 80, 100, totalRow],
            onChange: pageChangeHandle,
            itemRender: (page, type, originalElement) => {
                if (type === 'prev') {
                    return <Button>上一页</Button>
                }
                if (type === 'next') {
                    return <Button>下一页</Button>
                }
                return originalElement;
            }
        }
        return (
            <>
                <div className="pagination_module">
                    <Pagination {...paginationProps}/>
                </div>
            </>
        )
    }
}

export default PaginationComponent;